import request from '@/utils/request'

// 获取模型域顶层域列表
export const getRootDomainListApi = (data) =>
  request.get('/core/vom/model/design/root-device-domain/list', data)

// 获取模型域子域列表
export const getChildDomainListApi = (id) =>
  request.get(`/core/vom/model/design/child-domain/list?parentId=${id}`)

// 新增模型域顶层域列表
export const addRootDomainApi = (data) =>
  request.post('/core/vom/model/design/root-domain', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 新增模型域子域列表
export const addChildDomainApi = (data) =>
  request.post('/core/vom/model/design/domain', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 删除模型域
export const delDomainApi = (id) =>
  request.post(
    '/core/vom/model/design/domain/delete',
    {
      domainId: id
    },
    {
      headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    }
  )
// 查询模型域、信息
export const getDomainDataApi = (id) =>
  request.get(`/core/vom/model/design/domain?domainId=${id}`)

// 修改模型域
export const editDomainApi = (data) =>
  request.post('/core/vom/model/design/domain/put', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 上移模型域
export const upDomainApi = (data) =>
  request.post('/core/vom/model/design/domain/move-up', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 下移模型域
export const downDomainApi = (data) =>
  request.post('/core/vom/model/design/domain/move-down', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })
